package cn.hd.service.impl;

import cn.hd.dao.PowerDao;
import cn.hd.entity.Power;
import cn.hd.service.PowerService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Service
public class PowerServiceImpl implements PowerService {
    @Autowired
    private PowerDao powerDao;

    @Override
    public PageInfo<Power> selectPowers(int pagenum, int pagesize, Map map) {
        PageHelper.startPage(pagenum,pagesize);
        List<Power> powers = powerDao.selectPowers(map);
        PageInfo<Power> page = new PageInfo<>(powers);
        return page;
    }

    @Override
    public List<Power> selecyOneTwoPower() {
        System.out.println(powerDao.selectOneTwoPower());
        return powerDao.selectOneTwoPower();
    }

    @Override
    public List<Power> selectPowerbyUid(int id) {
        return powerDao.selectPowerbyUid(id);
    }
}
